package com.acp.service.impl;

import com.acp.context.Config;
import com.acp.dao.acpo.DcsFeedbackMapper;
import com.acp.model.DcsFeedback;
import com.acp.result.ResultInfo;
import com.acp.result.ResultUtil;
import com.acp.service.DcsFeedbackService;
import com.acp.util.UUIDBuild;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
/**
 * All rights Reserved, Designed By 姑苏区政府大数据中心
 *
 * @version V1.0
 * @Title: null.java
 * @Package com.dci.controller.construction
 * @Description: 反馈信息实现类
 * @author: 张星亮
 * @date: 2019/4/5
 * @Copyright: 2019 姑苏区政府大数据中心. All rights reserved.
 * 注意：本内容仅限于姑苏区政府大数据中心内部传阅，禁止外泄以及用于其他的商业目
 */
@Service
public class DcsFeedbackServiceImpl implements DcsFeedbackService {

    @Resource
    private DcsFeedbackMapper dcsFeedbackMapper;

    /**
     * 添加反馈
     * @param dcsFeedback
     * @return 返回ResultInfo 封装的返回参数  保存成功msg:906 保存失败msg:911
     */
    @Override
    public ResultInfo addDcsFeedback(DcsFeedback dcsFeedback) {
        dcsFeedback.setFeedback_id(UUIDBuild.getUUID());
        int i = dcsFeedbackMapper.insert(dcsFeedback);
        if (i > 0) {
            return ResultUtil.createSuccess(Config.MESSAGE, 906, null);

        }
        return ResultUtil.createWarning(Config.MESSAGE, 911, null);
    }

    /**
     * 删除反馈
     * @param id
     * @return 返回ResultInfo 封装的返回参数  保存成功msg:906 保存失败msg:911
     */
    @Override
    public int deleteFeedback(String id) {
        int i = dcsFeedbackMapper.delete(id);
        return i;
    }

}
